package com.jingsheng.jingshengcity.mvp.ui.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.jingsheng.jingshengcity.R;
import com.jingsheng.jingshengcity.mvp.ui.holder.MyViewHolder;
import com.jingsheng.jingshengcity.widgets.decoration.GridItemDecoration;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/5/10.
 */

public class ShoppingCartFragmentAdapter extends BaseQuickAdapter<String, MyViewHolder> {

    public ShoppingCartFragmentAdapter(@LayoutRes int layoutResId, @Nullable List<String> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(MyViewHolder helper, String item) {

        List<String> list = new ArrayList<>();
        list.add("1");

        RecyclerView recyclerView = helper.getView(R.id.rv_list);
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        ShoppingCartGoodsFragmentAdapter adapter = new ShoppingCartGoodsFragmentAdapter(R.layout.adapter_shopping_cart_goods_item, list);
        adapter.openLoadAnimation();
        recyclerView.addItemDecoration(new GridItemDecoration(mContext, R.drawable.list_gray_devider));
        recyclerView.setAdapter(adapter);

    }
}
